\(\int x^3 (a+b \arctan (c x))^2 \, dx\) [15]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 112 \[ \int x^3 (a+b \arctan (c x))^2 \, dx=\frac {a b x}{2 c^3}+\frac {b^2 x^2}{12 c^2}+\frac {b^2 x \arctan (c x)}{2 c^3}-\frac {b x^3 (a+b \arctan (c x))}{6 c}-\frac {(a+b \arctan (c x))^2}{4 c^4}+\frac {1}{4} x^4 (a+b \arctan (c x))^2-\frac {b^2 \log \left (1+c^2 x^2\right )}{3 c^4} \]

[Out]

1/2*a*b*x/c^3+1/12*b^2*x^2/c^2+1/2*b^2*x*arctan(c*x)/c^3-1/6*b*x^3*(a+b*arctan(c*x))/c-1/4*(a+b*arctan(c*x))^2
/c^4+1/4*x^4*(a+b*arctan(c*x))^2-1/3*b^2*ln(c^2*x^2+1)/c^4

Rubi [A] (verified)

Time = 0.15 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {4946, 5036, 272, 45, 4930, 266, 5004} \[ \int x^3 (a+b \arctan (c x))^2 \, dx=-\frac {(a+b \arctan (c x))^2}{4 c^4}+\frac {1}{4} x^4 (a+b \arctan (c x))^2-\frac {b x^3 (a+b \arctan (c x))}{6 c}+\frac {a b x}{2 c^3}+\frac {b^2 x \arctan (c x)}{2 c^3}+\frac {b^2 x^2}{12 c^2}-\frac {b^2 \log \left (c^2 x^2+1\right )}{3 c^4} \]

[In]

Int[x^3*(a + b*ArcTan[c*x])^2,x]

[Out]

(a*b*x)/(2*c^3) + (b^2*x^2)/(12*c^2) + (b^2*x*ArcTan[c*x])/(2*c^3) - (b*x^3*(a + b*ArcTan[c*x]))/(6*c) - (a +
b*ArcTan[c*x])^2/(4*c^4) + (x^4*(a + b*ArcTan[c*x])^2)/4 - (b^2*Log[1 + c^2*x^2])/(3*c^4)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 272

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 4930

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*ArcTan[c*x^n])^p, x] - Dist[b*c
*n*p, Int[x^n*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))), x], x] /; FreeQ[{a, b, c, n}, x] && IGtQ[p, 0
] && (EqQ[n, 1] || EqQ[p, 1])

Rule 4946

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)*((a + b*ArcTan[c*x^
n])^p/(m + 1)), x] - Dist[b*c*n*(p/(m + 1)), Int[x^(m + n)*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))),
x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0] && (EqQ[p, 1] || (EqQ[n, 1] && IntegerQ[m])) && NeQ[m, -1]

Rule 5004

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTan[c*x])^(p +
 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rule 5036

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Dist[f^2/
e, Int[(f*x)^(m - 2)*(a + b*ArcTan[c*x])^p, x], x] - Dist[d*(f^2/e), Int[(f*x)^(m - 2)*((a + b*ArcTan[c*x])^p/
(d + e*x^2)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && GtQ[p, 0] && GtQ[m, 1]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{4} x^4 (a+b \arctan (c x))^2-\frac {1}{2} (b c) \int \frac {x^4 (a+b \arctan (c x))}{1+c^2 x^2} \, dx \\ & = \frac {1}{4} x^4 (a+b \arctan (c x))^2-\frac {b \int x^2 (a+b \arctan (c x)) \, dx}{2 c}+\frac {b \int \frac {x^2 (a+b \arctan (c x))}{1+c^2 x^2} \, dx}{2 c} \\ & = -\frac {b x^3 (a+b \arctan (c x))}{6 c}+\frac {1}{4} x^4 (a+b \arctan (c x))^2+\frac {1}{6} b^2 \int \frac {x^3}{1+c^2 x^2} \, dx+\frac {b \int (a+b \arctan (c x)) \, dx}{2 c^3}-\frac {b \int \frac {a+b \arctan (c x)}{1+c^2 x^2} \, dx}{2 c^3} \\ & = \frac {a b x}{2 c^3}-\frac {b x^3 (a+b \arctan (c x))}{6 c}-\frac {(a+b \arctan (c x))^2}{4 c^4}+\frac {1}{4} x^4 (a+b \arctan (c x))^2+\frac {1}{12} b^2 \text {Subst}\left (\int \frac {x}{1+c^2 x} \, dx,x,x^2\right )+\frac {b^2 \int \arctan (c x) \, dx}{2 c^3} \\ & = \frac {a b x}{2 c^3}+\frac {b^2 x \arctan (c x)}{2 c^3}-\frac {b x^3 (a+b \arctan (c x))}{6 c}-\frac {(a+b \arctan (c x))^2}{4 c^4}+\frac {1}{4} x^4 (a+b \arctan (c x))^2+\frac {1}{12} b^2 \text {Subst}\left (\int \left (\frac {1}{c^2}-\frac {1}{c^2 \left (1+c^2 x\right )}\right ) \, dx,x,x^2\right )-\frac {b^2 \int \frac {x}{1+c^2 x^2} \, dx}{2 c^2} \\ & = \frac {a b x}{2 c^3}+\frac {b^2 x^2}{12 c^2}+\frac {b^2 x \arctan (c x)}{2 c^3}-\frac {b x^3 (a+b \arctan (c x))}{6 c}-\frac {(a+b \arctan (c x))^2}{4 c^4}+\frac {1}{4} x^4 (a+b \arctan (c x))^2-\frac {b^2 \log \left (1+c^2 x^2\right )}{3 c^4} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 111, normalized size of antiderivative = 0.99 \[ \int x^3 (a+b \arctan (c x))^2 \, dx=\frac {c x \left (6 a b+b^2 c x-2 a b c^2 x^2+3 a^2 c^3 x^3\right )-2 b \left (b c x \left (-3+c^2 x^2\right )+a \left (3-3 c^4 x^4\right )\right ) \arctan (c x)+3 b^2 \left (-1+c^4 x^4\right ) \arctan (c x)^2-4 b^2 \log \left (1+c^2 x^2\right )}{12 c^4} \]

[In]

Integrate[x^3*(a + b*ArcTan[c*x])^2,x]

[Out]

(c*x*(6*a*b + b^2*c*x - 2*a*b*c^2*x^2 + 3*a^2*c^3*x^3) - 2*b*(b*c*x*(-3 + c^2*x^2) + a*(3 - 3*c^4*x^4))*ArcTan
[c*x] + 3*b^2*(-1 + c^4*x^4)*ArcTan[c*x]^2 - 4*b^2*Log[1 + c^2*x^2])/(12*c^4)

Maple [A] (verified)

Time = 1.02 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.05

method result size
parts \(\frac {a^{2} x^{4}}{4}+\frac {b^{2} \left (\frac {c^{4} x^{4} \arctan \left (c x \right )^{2}}{4}-\frac {c^{3} x^{3} \arctan \left (c x \right )}{6}+\frac {c x \arctan \left (c x \right )}{2}-\frac {\arctan \left (c x \right )^{2}}{4}+\frac {c^{2} x^{2}}{12}-\frac {\ln \left (c^{2} x^{2}+1\right )}{3}\right )}{c^{4}}+\frac {2 a b \left (\frac {c^{4} x^{4} \arctan \left (c x \right )}{4}-\frac {c^{3} x^{3}}{12}+\frac {c x}{4}-\frac {\arctan \left (c x \right )}{4}\right )}{c^{4}}\) \(118\)
derivativedivides \(\frac {\frac {a^{2} c^{4} x^{4}}{4}+b^{2} \left (\frac {c^{4} x^{4} \arctan \left (c x \right )^{2}}{4}-\frac {c^{3} x^{3} \arctan \left (c x \right )}{6}+\frac {c x \arctan \left (c x \right )}{2}-\frac {\arctan \left (c x \right )^{2}}{4}+\frac {c^{2} x^{2}}{12}-\frac {\ln \left (c^{2} x^{2}+1\right )}{3}\right )+2 a b \left (\frac {c^{4} x^{4} \arctan \left (c x \right )}{4}-\frac {c^{3} x^{3}}{12}+\frac {c x}{4}-\frac {\arctan \left (c x \right )}{4}\right )}{c^{4}}\) \(119\)
default \(\frac {\frac {a^{2} c^{4} x^{4}}{4}+b^{2} \left (\frac {c^{4} x^{4} \arctan \left (c x \right )^{2}}{4}-\frac {c^{3} x^{3} \arctan \left (c x \right )}{6}+\frac {c x \arctan \left (c x \right )}{2}-\frac {\arctan \left (c x \right )^{2}}{4}+\frac {c^{2} x^{2}}{12}-\frac {\ln \left (c^{2} x^{2}+1\right )}{3}\right )+2 a b \left (\frac {c^{4} x^{4} \arctan \left (c x \right )}{4}-\frac {c^{3} x^{3}}{12}+\frac {c x}{4}-\frac {\arctan \left (c x \right )}{4}\right )}{c^{4}}\) \(119\)
parallelrisch \(-\frac {-3 x^{4} \arctan \left (c x \right )^{2} b^{2} c^{4}-6 x^{4} \arctan \left (c x \right ) a b \,c^{4}-3 a^{2} c^{4} x^{4}+2 b^{2} \arctan \left (c x \right ) x^{3} c^{3}+2 a b \,c^{3} x^{3}-b^{2} c^{2} x^{2}-6 b^{2} \arctan \left (c x \right ) x c -6 a b c x +3 b^{2} \arctan \left (c x \right )^{2}+4 b^{2} \ln \left (c^{2} x^{2}+1\right )+6 a b \arctan \left (c x \right )+b^{2}}{12 c^{4}}\) \(139\)
risch \(-\frac {b^{2} \left (c^{4} x^{4}-1\right ) \ln \left (i c x +1\right )^{2}}{16 c^{4}}-\frac {i b \left (6 a \,c^{4} x^{4}+3 i b \,c^{4} x^{4} \ln \left (-i c x +1\right )-2 b \,c^{3} x^{3}+6 x b c -3 i b \ln \left (-i c x +1\right )\right ) \ln \left (i c x +1\right )}{24 c^{4}}-\frac {b^{2} x^{4} \ln \left (-i c x +1\right )^{2}}{16}+\frac {i a b \,x^{4} \ln \left (-i c x +1\right )}{4}-\frac {i b^{2} x^{3} \ln \left (-i c x +1\right )}{12 c}+\frac {a^{2} x^{4}}{4}-\frac {a b \,x^{3}}{6 c}+\frac {i b^{2} x \ln \left (-i c x +1\right )}{4 c^{3}}+\frac {b^{2} x^{2}}{12 c^{2}}+\frac {b^{2} \ln \left (-i c x +1\right )^{2}}{16 c^{4}}+\frac {a b x}{2 c^{3}}-\frac {a b \arctan \left (c x \right )}{2 c^{4}}-\frac {b^{2} \ln \left (c^{2} x^{2}+1\right )}{3 c^{4}}\) \(254\)

[In]

int(x^3*(a+b*arctan(c*x))^2,x,method=_RETURNVERBOSE)

[Out]

1/4*a^2*x^4+b^2/c^4*(1/4*c^4*x^4*arctan(c*x)^2-1/6*c^3*x^3*arctan(c*x)+1/2*c*x*arctan(c*x)-1/4*arctan(c*x)^2+1
/12*c^2*x^2-1/3*ln(c^2*x^2+1))+2*a*b/c^4*(1/4*c^4*x^4*arctan(c*x)-1/12*c^3*x^3+1/4*c*x-1/4*arctan(c*x))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.08 \[ \int x^3 (a+b \arctan (c x))^2 \, dx=\frac {3 \, a^{2} c^{4} x^{4} - 2 \, a b c^{3} x^{3} + b^{2} c^{2} x^{2} + 6 \, a b c x + 3 \, {\left (b^{2} c^{4} x^{4} - b^{2}\right )} \arctan \left (c x\right )^{2} - 4 \, b^{2} \log \left (c^{2} x^{2} + 1\right ) + 2 \, {\left (3 \, a b c^{4} x^{4} - b^{2} c^{3} x^{3} + 3 \, b^{2} c x - 3 \, a b\right )} \arctan \left (c x\right )}{12 \, c^{4}} \]

[In]

integrate(x^3*(a+b*arctan(c*x))^2,x, algorithm="fricas")

[Out]

1/12*(3*a^2*c^4*x^4 - 2*a*b*c^3*x^3 + b^2*c^2*x^2 + 6*a*b*c*x + 3*(b^2*c^4*x^4 - b^2)*arctan(c*x)^2 - 4*b^2*lo
g(c^2*x^2 + 1) + 2*(3*a*b*c^4*x^4 - b^2*c^3*x^3 + 3*b^2*c*x - 3*a*b)*arctan(c*x))/c^4

Sympy [A] (verification not implemented)

Time = 0.38 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.38 \[ \int x^3 (a+b \arctan (c x))^2 \, dx=\begin {cases} \frac {a^{2} x^{4}}{4} + \frac {a b x^{4} \operatorname {atan}{\left (c x \right )}}{2} - \frac {a b x^{3}}{6 c} + \frac {a b x}{2 c^{3}} - \frac {a b \operatorname {atan}{\left (c x \right )}}{2 c^{4}} + \frac {b^{2} x^{4} \operatorname {atan}^{2}{\left (c x \right )}}{4} - \frac {b^{2} x^{3} \operatorname {atan}{\left (c x \right )}}{6 c} + \frac {b^{2} x^{2}}{12 c^{2}} + \frac {b^{2} x \operatorname {atan}{\left (c x \right )}}{2 c^{3}} - \frac {b^{2} \log {\left (x^{2} + \frac {1}{c^{2}} \right )}}{3 c^{4}} - \frac {b^{2} \operatorname {atan}^{2}{\left (c x \right )}}{4 c^{4}} & \text {for}\: c \neq 0 \\\frac {a^{2} x^{4}}{4} & \text {otherwise} \end {cases} \]

[In]

integrate(x**3*(a+b*atan(c*x))**2,x)

[Out]

Piecewise((a**2*x**4/4 + a*b*x**4*atan(c*x)/2 - a*b*x**3/(6*c) + a*b*x/(2*c**3) - a*b*atan(c*x)/(2*c**4) + b**
2*x**4*atan(c*x)**2/4 - b**2*x**3*atan(c*x)/(6*c) + b**2*x**2/(12*c**2) + b**2*x*atan(c*x)/(2*c**3) - b**2*log
(x**2 + c**(-2))/(3*c**4) - b**2*atan(c*x)**2/(4*c**4), Ne(c, 0)), (a**2*x**4/4, True))

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.21 \[ \int x^3 (a+b \arctan (c x))^2 \, dx=\frac {1}{4} \, b^{2} x^{4} \arctan \left (c x\right )^{2} + \frac {1}{4} \, a^{2} x^{4} + \frac {1}{6} \, {\left (3 \, x^{4} \arctan \left (c x\right ) - c {\left (\frac {c^{2} x^{3} - 3 \, x}{c^{4}} + \frac {3 \, \arctan \left (c x\right )}{c^{5}}\right )}\right )} a b - \frac {1}{12} \, {\left (2 \, c {\left (\frac {c^{2} x^{3} - 3 \, x}{c^{4}} + \frac {3 \, \arctan \left (c x\right )}{c^{5}}\right )} \arctan \left (c x\right ) - \frac {c^{2} x^{2} + 3 \, \arctan \left (c x\right )^{2} - 4 \, \log \left (c^{2} x^{2} + 1\right )}{c^{4}}\right )} b^{2} \]

[In]

integrate(x^3*(a+b*arctan(c*x))^2,x, algorithm="maxima")

[Out]

1/4*b^2*x^4*arctan(c*x)^2 + 1/4*a^2*x^4 + 1/6*(3*x^4*arctan(c*x) - c*((c^2*x^3 - 3*x)/c^4 + 3*arctan(c*x)/c^5)
)*a*b - 1/12*(2*c*((c^2*x^3 - 3*x)/c^4 + 3*arctan(c*x)/c^5)*arctan(c*x) - (c^2*x^2 + 3*arctan(c*x)^2 - 4*log(c
^2*x^2 + 1))/c^4)*b^2

Giac [F]

\[ \int x^3 (a+b \arctan (c x))^2 \, dx=\int { {\left (b \arctan \left (c x\right ) + a\right )}^{2} x^{3} \,d x } \]

[In]

integrate(x^3*(a+b*arctan(c*x))^2,x, algorithm="giac")

[Out]

sage0*x

Mupad [B] (verification not implemented)

Time = 0.34 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.20 \[ \int x^3 (a+b \arctan (c x))^2 \, dx=\frac {3\,a^2\,c^4\,x^4-4\,b^2\,\ln \left (c^2\,x^2+1\right )-3\,b^2\,{\mathrm {atan}\left (c\,x\right )}^2+b^2\,c^2\,x^2-6\,a\,b\,\mathrm {atan}\left (c\,x\right )-2\,b^2\,c^3\,x^3\,\mathrm {atan}\left (c\,x\right )+6\,b^2\,c\,x\,\mathrm {atan}\left (c\,x\right )+3\,b^2\,c^4\,x^4\,{\mathrm {atan}\left (c\,x\right )}^2-2\,a\,b\,c^3\,x^3+6\,a\,b\,c\,x+6\,a\,b\,c^4\,x^4\,\mathrm {atan}\left (c\,x\right )}{12\,c^4} \]

[In]

int(x^3*(a + b*atan(c*x))^2,x)

[Out]

(3*a^2*c^4*x^4 - 4*b^2*log(c^2*x^2 + 1) - 3*b^2*atan(c*x)^2 + b^2*c^2*x^2 - 6*a*b*atan(c*x) - 2*b^2*c^3*x^3*at
an(c*x) + 6*b^2*c*x*atan(c*x) + 3*b^2*c^4*x^4*atan(c*x)^2 - 2*a*b*c^3*x^3 + 6*a*b*c*x + 6*a*b*c^4*x^4*atan(c*x
))/(12*c^4)